home *** CD-ROM | disk | FTP | other *** search
/ The Programmer Disk / The Programmer Disk (Microforum).iso / xpro / qb2 / pro20 / scrndump.bas < prev    next >
Encoding:
BASIC Source File  |  1988-07-26  |  1.9 KB  |  61 lines

  1.  
  2. DEFINT A-Z
  3. SUB HerculesPrintScreen STATIC
  4.  
  5.  
  6.    'Print screen utility for Hercules (tm) and compatible video cards
  7.    'and Epson and strictly compatible printers.
  8.  
  9.    DEF SEG = &HB000       'set segment pointer to begining of screen 3 page 0
  10.                                                               
  11.    WIDTH "LPT1:", 255     'set print width to 256 bytes wide
  12.    n2 = 1                 'number of columns for printing (INT (348/256))
  13.    n1 = 347 - (255)       'second number of colums for printing
  14.   
  15.    OPEN "LPT1:BIN" FOR OUTPUT AS 1    'Open printer device, binary mode
  16.    
  17.    PRINT #1, CHR$(27); "A"; CHR$(8);
  18.                           'set printer line feed to 8/72"
  19.  
  20.    FOR x = 89 TO 0 STEP -1
  21.       PRINT #1, CHR$(27); "K"; CHR$(n1); CHR$(n2);
  22.       '   set printer for single density bit image graphics mode
  23.  
  24.       FOR y = x TO x + 7830 STEP 90
  25.  
  26.          FOR t = 0 TO 3             '
  27.                                     '
  28.             y1 = t * 8192           'step through each of the four scan lines
  29.             a = PEEK(y + y1)        '
  30.            
  31.             b = 0
  32.          
  33.             '***************** Flip byte for printer ******************
  34.             '
  35.             'This routine flips the byte that was taken from the screen
  36.             'so that it appears right-side-up on the printer.
  37.           
  38.             IF (a AND &H80) = &H80 THEN b = b + &H1
  39.             IF (a AND &H40) = &H40 THEN b = b + &H2
  40.             IF (a AND &H20) = &H20 THEN b = b + &H4
  41.             IF (a AND &H10) = &H10 THEN b = b + &H8
  42.             IF (a AND &H8) = &H8 THEN b = b + &H10
  43.             IF (a AND &H4) = &H4 THEN b = b + &H20
  44.             IF (a AND &H2) = &H2 THEN b = b + &H40
  45.             IF (a AND &H1) = &H1 THEN b = b + &H80
  46.  
  47.             PRINT #1, CHR$(b);
  48.             '  print information in bit image graphics to the printer
  49.  
  50.          NEXT t
  51.      
  52.       NEXT y
  53.       PRINT #1,
  54.  
  55.    NEXT x
  56.  
  57.    CLOSE 1
  58.  
  59. END SUB
  60.  
  61.